Skip to content

Conversation

MaxDesiatov
Copy link
Contributor

This change fixes some of the issues that appear when building this library with Embedded Swift. It adds missing concurrency imports and avoids use of throwing tasks that are not supported in Embedded Swift. Standard Swift's Result type is used instead to express error throwing.

This change fixes some of the issues that appear when building this library with Embedded Swift. It adds missing concurrency imports and avoids use of throwing tasks that are not supported in Embedded Swift. Standard Swift's `Result` type is used instead to express error throwing.
@MaxDesiatov MaxDesiatov changed the title Fix some Embedded Swift issues in JavaScriptEventLoop Fix some Embedded Swift issues in JavaScriptEventLoop Apr 16, 2025
}
}

/// Wait for the promise to complete, returning its result or exception as a Result.
///
/// - Note: Calling this function does not switch from the caller's isolation domain.
public func value(isolation: isolated (any Actor)? = #isolation) async throws -> JSValue {
try await withUnsafeThrowingContinuation(isolation: isolation) { [self] continuation in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a typed-throws version of withContinuation 😔

@kateinoigakukun kateinoigakukun merged commit d3b26d3 into main Apr 16, 2025
6 checks passed
@kateinoigakukun kateinoigakukun deleted the maxd/embedded-concurrency1 branch April 16, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants